// import com.alibaba.druid.sql.ast.SQLObjectImpl;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

#include "SQLTableLike.h"
#include "SQLExprTableSource.h"
#include "../../../sql/visitor/SQLASTVisitor.h"

// @Override
void SQLTableLike::accept0(SQLASTVisitor_ptr v)
{
  if (v->visit(SharedObject(SQLTableLike)))
  {
    acceptChild(v, table);
  }
  v->endVisit(SharedObject(SQLTableLike));
}

SQLObject_ptr SQLTableLike::clone()
{
  SQLObject_ptr clone_tmp = SQLTableLike_ptr(new SQLTableLike());
  SQLTableLike_ptr x = std::dynamic_pointer_cast<SQLTableLike>(clone_tmp);
  // SQLTableLike *x = new SQLTableLike();
  if (table != nullptr)
  {
    x->setTable(std::dynamic_pointer_cast<SQLExprTableSource>(table->clone()));
  }

  return x;
}

SQLExprTableSource_ptr SQLTableLike::getTable()
{
  return table;
}

void SQLTableLike::setTable(SQLExprTableSource_ptr x)
{
  if (x != nullptr)
  {
    x->setParent(SharedObject(SQLTableLike));
  }
  this->table = x;
}

BOOL_ptr SQLTableLike::isIncludeProperties()
{
  return includeProperties;
}

void SQLTableLike::setIncludeProperties(BOOL_ptr includeProperties)
{
  this->includeProperties = includeProperties;
}

BOOL_ptr SQLTableLike::isExcludeProperties()
{
  return excludeProperties;
}

void SQLTableLike::setExcludeProperties(BOOL_ptr excludeProperties)
{
  this->excludeProperties = excludeProperties;
}
